<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  xml:lang="zh-CN" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加网址</title>
<link rel="stylesheet" href="{&$skin}/html.css" type="text/css" />
<link rel="stylesheet" href="{&$skin}/sform.css" type="text/css" />
<link rel="stylesheet" href="{&$skin}/fwin.css" type="text/css" />
<script type="text/javascript" src="{&$js}/simple.js"></script>
<style type="text/css">
.sform .inline label{width:16%;}
.sform select{width:36%;height:20px;}
.sform .textput{width:60%;height:20px;}
</style>
<script type="text/javascript">
function checkAdd(form)
{
	if (form.url.value == '') {
		form.url.focus();
		return false;
	}
	if (form.title.value == '') {
		form.title.focus();
		return false;
	}
	return true;
}
function newcata_open() {
	$('mycata').style.display = "none";
	$('newcata').style.display = "block";
}
function newcata_close() {
	$('mycata').style.display = "block";
	$('newcata').style.display = "none";
}
function newcata_add() {
    val = $('newcata_name').value;
    if (val.trim() == '') {
        alert("请填写您要新建的目录名称！");
        return false;
    }
    var ops = $("cata").options;
    ops.add(new Option(val, val));
    ops[ops.length-1].selected = true;
    newcata_close();
}
</script>
</head>
<body>
<div class="fbox">
	<div class="title">添加收藏</div>
	<div class="cc">
	<form class="sform" name="loginForm" method="post" action="" onsubmit="return checkAdd(this)">
	<fieldset class="inline">
	<fieldset class="inline">
		<div class="field">
			<label>链接地址</label>
			<input type="text" name="url" class="textput" value="http://www.baidu.com" />
		</div>
		<div class="field">
			<label>收藏标题</label>
			<input type="text" name="title" class="textput" value="百度一下 你就知道" />
		</div>
		<div class="field">
			<label>放入目录</label>
			<div id="mycata">
				<select id="cata" name="cata">
					<option value="">默认收藏夹</option>
					<option value="">电子商务</option>
					<option value="">PHP</option>
				</select>
				<span style="padding-left:20px"><a href="javascript:newcata_open();" style="font-size:12px;">新建收藏夹</a></span>
			</div>
			<div id="newcata" style="display:none">
			<input type="text" name="newcata_name" id="newcata_name" class="textput" style="width:220px;" />
			<input type="button" value="确定" class="bnt-small" onclick="newcata_add()" />
			<input type="button" value="取消" class="bnt-small" onclick="newcata_close()" />
			</div>
		</div>
		<div class="field">
			<label>&nbsp;</label>
			<input type="submit" value="加入收藏" class="bnt-mid" />
		</div>
	</fieldset>
	</form>
	</div>
</div>
</body>
</html>